const express = require('express');
const router = express.Router();
const paymentController = require('../controllers/paymentController');
const { authenticateToken } = require('../middleware/authMiddleware');

// 需要身份验证的路由
router.post('/create', authenticateToken, paymentController.createPayment);
router.get('/status/:orderNumber', authenticateToken, paymentController.queryPaymentStatus);
router.get('/balance', authenticateToken, paymentController.getUserBalance);

// 支付通知路由 - 不需要身份验证，因为是第三方支付平台回调
router.post('/xunhupay/notify', paymentController.handlePaymentNotify);

module.exports = router;